/*
 * Created on 2005-3-23
 *
 * Copyright: Bluejay Networks Inc. 2005
 *
 * This software is the proprietary information of Bluejay Networks Inc. 
 * 
 * Use is subject to license terms.
 * 
 */
package com.ims.iaa.swf.datatype;
//A rectangle value represents a rectangular region defined by a minimum X- and Y-coordinate position with a maximum X- and Y-coordinate position. 
//RECT	  
//Field			Type				Comment	  
//Nbits			nBits = UB[5]		Bits used for each subsequent field	  
//Xmin			SB[nBits]			X minimum position for rectangle in twips	  
//Xmax			SB[nBits]			X maximum position for rectangle in twips	  
//Ymin			SB[nBits]			Y minimum position for rectangle in twips	  
//Ymax			SB[nBits]			Y maximum position for rectangle in twips	  

/**
 * @author ShengMengBai
 *
 * simulate the flash RECT data type;
 */
public class Rect{
    private int m_iStart = 0;
    private byte[] m_bytData = null;
    public Rect(byte[] bytData, int iStart){
        m_bytData = bytData;
        m_iStart = iStart;
        parse();
    }
    private void parse(){
		int iNBits = m_bytData[m_iStart] >> 3;
		int iBitSize = iNBits * 4 + 5;
		m_iSize = iBitSize / 8;
		if(iBitSize % 8 != 0){
		    m_iSize += 1;
		}
    }
    public int getXmin(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iXmin;
    }
    public int getXmax(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iXmax;
    }
    public int getYmin(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iYmin;
    }
    public int getYmax(){
        throw new RuntimeException("unImplement exception.");
    	//return m_iYmax;
    }
    public int getByteSize(){
    	return m_iSize;
    }
    private int m_iXmin;
    private int m_iXmax;
    private int m_iYmin;
    private int m_iYmax;
    private int m_iSize;


}
